package Homework3;

public class Digits {
    public static int digitCount(int[][] arr,int n) {
        int count = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                int a = arr[i][j];
                while (a != 0) {
                    int b = a % 10;
                    if (b == n) {
                        count++;
                    }
                    a /= 10;
                }
            }
        }
        return count;
    }
}
